package com.zryc.shop.ums.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zryc.shop.ums.entity.MemberLevel;
import com.zryc.shop.ums.mapper.MemberLevelMapper;
import com.zryc.shop.ums.service.IMemberLevelService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 会员等级表 服务实现类
 * </p>
 *
 * @author zhaozhao
 * @since 2024-01-16
 */
@Service
public class MemberLevelServiceImpl extends ServiceImpl<MemberLevelMapper, MemberLevel> implements IMemberLevelService {

    /**
     * 查询默认等级为defaultStatus的memberLevel
     *
     * @param defaultStatus
     * @return
     */
    @Override
    public Object list(Integer defaultStatus) {
        QueryWrapper<MemberLevel> wrapper = new QueryWrapper<>();
        if (defaultStatus != null) {
            wrapper.eq("default_status", defaultStatus);
        }
        return baseMapper.selectList(wrapper);
    }
}
